Skip to content

fix(signals): rank issue-quality report before capping to 100 - #2366

Merged
JSONbored merged 1 commit into
JSONbored:mainfrom
galuis116:fix/issue-quality-score-before-cap
Jul 1, 2026
Merged

fix(signals): rank issue-quality report before capping to 100#2366
JSONbored merged 1 commit into
JSONbored:mainfrom
galuis116:fix/issue-quality-score-before-cap

Conversation

@galuis116

Copy link
Copy Markdown
Contributor

Summary

  • buildIssueQualityReport in src/signals/engine.ts capped the open-issue list to the first 100
    (issues.filter((issue) => issue.state === "open").slice(0, 100)) before scoring and sorting by
    score. Once a repo has more than 100 open issues, whichever 100 happen to be first in the caller's
    input array (not necessarily the highest-quality ones) are the only issues ever scored — a genuinely
    stronger issue sitting past position 100 is dropped from the report entirely, even though it would
    outrank most of the retained 100.
  • This moves the cap to run after scoring and sorting (adds a named ISSUE_QUALITY_REPORT_CAP = 100
    constant, matching the existing MAX_COLLISION_PAIRWISE_ISSUES / ISSUE_DISCOVERY_LIFECYCLE_REPORT_CAP
    style), and updates the stale perf comment above it ("runs over up to 100 open issues" -> "runs over
    every open issue") since the per-issue indexes built just above already make the loop
    O(issues + PRs), so scoring every open issue instead of a pre-capped 100 is unaffected performance-wise.
  • No issue is linked: this repo's own .gittensory.yml sets issueDiscoveryPolicy: discouraged and
    linkedIssuePolicy: preferred (not required). This is a small, self-contained, self-evident fix
    confined to one file plus its regression test.

Scope

  • The PR title follows type(scope): short summary Conventional Commit format, for example fix(api): restore profile access checks.
  • This PR is focused and does not mix unrelated backend, UI, MCP, docs, dependency, and deploy changes.
  • This follows CONTRIBUTING.md and does not reintroduce GitHub Pages, VitePress, site/, or CNAME.
  • I linked an issue, or this is small enough that the summary explains why an issue is not needed.

Validation

  • git diff --check
  • npm run actionlint
  • npm run typecheck
  • npm run test:coverage locally; codecov/patch requires >=99% coverage of the lines AND branches you changed (aim for 100% on your diff so CI variance does not fail near the threshold). Global coverage is a non-blocking trend with a loose 90% backstop, not the gate.
  • npm run test:workers
  • npm run build:mcp
  • npm run test:mcp-pack
  • npm run ui:openapi:check
  • npm run ui:lint
  • npm run ui:typecheck
  • npm run ui:build
  • npm audit --audit-level=moderate
  • New or changed behavior has unit/integration tests for new branches, fallback paths, and sanitizer boundaries

If any required check was skipped, explain why:

  • The full npm run test:ci chain on this Windows dev machine stops at test:coverage because of a fixed set of pre-existing, environment-only failures unrelated to this diff: a CRLF-vs-LF mismatch from a Windows core.autocrlf checkout (gittensory-focus-manifest.test.ts), missing claude/codex CLI binaries on PATH (selfhost-ai.test.ts), a libuv/Windows subprocess assertion in the gittensory-mcp CLI test harness (mcp-cli-doctor.test.ts, mcp-cli-profiles.test.ts), and a couple of tests that are flaky under full-suite parallel load but pass individually (mcp-output-schemas.test.ts, one mcp-cli-doctor.test.ts case). None touch src/signals/** or the changed test file. The targeted suites for this change (issue-quality.test.ts, signals.test.ts, signals-coverage.test.ts) pass cleanly and tsc --noEmit is clean. I did not reach test:workers/build:mcp/ui:* locally because the &&-chained test:ci script stops at the first failing step; this PR does not touch workers, MCP packaging, or apps/gittensory-ui/**, so those steps are unaffected by the diff.

Safety

  • No secrets, wallet details, hotkeys, coldkeys, user PATs, private keys, raw trust scores, private rankings, or private maintainer evidence are exposed.
  • Public GitHub text stays sanitized, low-noise, and does not imply compensation guarantees or optimization tactics.
  • Auth, cookie, CORS, GitHub App, Cloudflare, or session changes include negative-path tests.
  • API/OpenAPI/MCP behavior is updated and tested where needed.
  • UI changes use live API data or real empty/error/loading states, not production mock/demo fallbacks.
  • Visible UI changes include a UI Evidence section below with JPG/JPEG or PNG screenshots arranged as organized, captioned, clickable thumbnails. SVG screenshots are not used as review evidence. Review-only screenshots or recordings are not committed to the repository.
  • Public docs/changelogs are updated where needed; changelogs are only edited for release-prep PRs.

If any required check was skipped, explain why: this PR has no auth/CORS/session surface and no UI change, so those boxes are not applicable.

Notes

  • Added a regression test (test/unit/issue-quality.test.ts) with 110 low-scoring filler issues
    followed by one high-scoring issue placed past the old cap boundary, asserting the strong issue is
    ranked first in the returned 100. I confirmed this by reverting the source change locally and
    observing the new test fail with the strong issue dropped and a low-scoring filler issue returned
    first instead.

@galuis116
galuis116 requested a review from JSONbored as a code owner July 1, 2026 12:41
@dosubot dosubot Bot added the size:XS label Jul 1, 2026
@loopover-orb

loopover-orb Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

Warning

🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨🟨

⏸️ Gittensory review result - manual review recommended

Review updated: 2026-07-01 19:01:26 UTC

2 files · 1 AI reviewer · no blockers · readiness 66/100 · CI green · clean

⏸️ Suggested Action - Manual Review

Review summary
The change correctly applies the 100-entry cap after building and ordering issue-quality entries, so high-quality open issues later in the input are no longer discarded before evaluation. The new constant keeps the limit named, and the regression test covers the previously broken ordering-before-cap behavior. I do not see a reachable correctness break in the visible diff.

Nits — 3 non-blocking
  • nit: test/unit/issue-quality.test.ts:309 hard-codes the exact numeric score for the fixture, which makes the regression test sensitive to unrelated model tuning; asserting that issue 111 is first, or above the filler entries, would keep the test focused on the cap-ordering regression.
  • test/unit/issue-quality.test.ts:309: replace the exact score assertion with a regression-focused assertion such as `expect(report.issues[0]).toMatchObject({ number: 111 })` plus a check that none of the dropped filler issue numbers displaced it.
  • Readiness score is below the configured threshold — Use the readiness panel as advisory maintainer context; the score does not block this PR.
Signal Result Evidence
Code review ✅ No blockers 1 reviewer
Linked issue ⚠️ Missing No linked issue or no-issue rationale found.
Related work ✅ No active overlap found No same-issue or scoped active PR overlap found.
Change scope ✅ 20/20 Low review scope from cached public metadata (size label size:XS; no linked issue context).
Validation posture ❌ 5/25 Preflight is holding this PR: the review lane is unavailable, so it is not ready for automated review.
Contributor workload ✅ 10/10 Author activity: 1794 registered-repo PR(s), 1180 merged, 142 issue(s).
Contributor context ✅ Confirmed Gittensor contributor galuis116; Gittensor profile; 1794 PR(s), 142 issue(s).
Gate result ✅ Passing No configured blocker found.
Review context
  • Author: galuis116
  • Role context: outside_contributor
  • Public audience mode: oss maintainer
  • Lane context: Repository registration is not available in the local Gittensory cache.
  • Public profile languages: JavaScript, Dart, TypeScript, Python, HTML, MDX, Rust, C++
  • Official Gittensor activity: 1794 PR(s), 142 issue(s).
  • PR-specific overlap: none found.
Contributor next steps
  • Explain no-issue PR.
  • Await review-lane availability.
  • Triage stale or unlinked PRs.
  • Refresh registry data or choose a registered active repo.
  • Link the issue being solved, or explicitly explain why this is a no-issue PR.
Signal definitions
  • Related work = same linked issue, overlapping active PRs, or title/path similarity.
  • Change scope = cached public metadata such as size labels, draft state, and review-burden hints.
  • Validation posture = whether the PR provides enough public validation/test evidence for maintainer review.
  • Contributor workload = public contributor activity and cleanup pressure, not a repo-wide quality failure.
  • Contributor context = public GitHub/Gittensor identity context; non-Gittensor status is not a blocker.

🟩 Safe / merged · 🟦 Advisory · 🟨 Held for review · 🟥 Blocked / closed


💰 Earn for open-source contributions like this. Gittensor lets GitHub contributors earn for the work they already do — register to start earning →.

Checked by Gittensory, a quiet PR intelligence layer for OSS maintainers.

  • Re-run Gittensory review

@loopover-orb loopover-orb Bot added gittensor gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier. labels Jul 1, 2026
@codecov

codecov Bot commented Jul 1, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 95.74%. Comparing base (836e8e9) to head (f4e136c).
⚠️ Report is 4 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main    #2366      +/-   ##
==========================================
+ Coverage   95.71%   95.74%   +0.02%     
==========================================
  Files         222      222              
  Lines       24653    24654       +1     
  Branches     8945     8945              
==========================================
+ Hits        23597    23604       +7     
  Misses        433      433              
+ Partials      623      617       -6     
Files with missing lines Coverage Δ
src/signals/engine.ts 97.71% <100.00%> (+0.35%) ⬆️
🚀 New features to boost your workflow:
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@dosubot dosubot Bot added the lgtm label Jul 1, 2026
@JSONbored
JSONbored merged commit f8d6970 into JSONbored:main Jul 1, 2026
9 checks passed
@github-project-automation github-project-automation Bot moved this from Todo to Done in gittensory - v1 roadmap Jul 1, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

gittensor:bug Gittensor-scored bug fix — scores a 0.05x multiplier.

Projects

No open projects
Status: Done

Development

Successfully merging this pull request may close these issues.

2 participants